package com.steel.yfmall.cloud.assistant.dto.result.goods;

import com.steel.yfmall.cloud.assistant.dto.zg.price.Sr063Bean;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
public class ResultProductPriceFormFactorDatailsBean implements Serializable {

    private static final long serialVersionUID = -6669000413498108678L;
    /**
     *  @Fields id
     */
    private Integer id;

    /**
     *  @Fields product_price_form_id 所属商品价格组成
     */
    private Integer productPriceFormId;

    /**
     *  @Fields jyjt_product_price_form_id 中冠价格值ID
     */
    private String jyjtProductPriceFormId;

    /**
     *  @Fields price 价格
     */
    private BigDecimal price;

    /**
     *  @Fields status 状态(0未确认,1确认)
     */
    private Integer status;

    /**
     *  @Fields version 价格版本
     */
    private String version;

    /**
     *  @Fields create_date 创建时间
     */
    private Date createDate;

    /**
     *  @Fields update_date 修改时间
     */
    private Date updateDate;

    /**
     *  @Fields memo 备注
     */
    private String memo;

    /**
     *  @Fields product_price_form_factor_detail 价格组成因子json [{"facVal": "等于值","fatValueMax": "最大值","fatValueMin": "最小值","priceFactor": "价格代码"}]
     */
    private String productPriceFormFactorDetail;

    /**
     * 价格组成因子list集合
     */
    private List<Sr063Bean> productPriceFormFactorDetailList;

    /**
     * 组成因子Map  key为priceFactor
     */
    private Map<String,Sr063Bean>  productPriceFormFactorDetailMap;


    public Map<String, Sr063Bean> getProductPriceFormFactorDetailMap() {
        Map<String, Sr063Bean> returnMap = null;
        if(productPriceFormFactorDetailList != null && productPriceFormFactorDetailList.size() > 0){
            returnMap= new HashMap<>();
            for(Sr063Bean Sr063Bean:productPriceFormFactorDetailList){
                returnMap.put(Sr063Bean.getPriceFactor(),Sr063Bean);
            }
            productPriceFormFactorDetailMap = returnMap;
        }
        return productPriceFormFactorDetailMap;
    }

    public void setProductPriceFormFactorDetailMap(Map<String, Sr063Bean> productPriceFormFactorDetailMap) {
        this.productPriceFormFactorDetailMap = productPriceFormFactorDetailMap;
    }
}
